<?php if(!IS_AJAX){?>

<include file="Public:header" />
<div class="row">
  <div class="col-sm-7 col-md-8 col-lg-9">
    <section class="panel">
      <div class="panel-body">
        <table class="" width="100%" border="0" cellspacing="0" cellpadding="0">
         
          <tbody class="ajaxdatalist" id="ajaxdatalist">
            <?php }?>
            
            
            
            <?php if(IS_AJAX){?>
            <!-- 数据主体 -->
            
            <volist name="list" id="vo">
            <tr><td>
  <table width="100%" border="0" style="box-shadow:1px 2px 5px #ccc;" class="table table-bordered" cellspacing="0" cellpadding="0">
  <tbody>
    <tr>
      <td colspan="2">订单号：{$vo.ordernumber}&nbsp;&nbsp;&nbsp;下单时间：{:date('Y-m-d H:i:s',$vo['create_time'])}&nbsp;&nbsp;&nbsp;<!-- 0未发货，1部分发货，2全部发货，3部分确认，4全部确认 -->
    <eq name="vo['shipping_status']" value="0">未发货</eq>
    <eq name="vo['shipping_status']" value="1"><span style="color:#E8EB99; font-weight:bold; padding:4px; background:#D9534F;">部分发货</span></eq>
    <eq name="vo['shipping_status']" value="2"><span style="color:#C7CC3A; font-weight:bold; padding:4px;">全部发货</span></eq>
    <eq name="vo['shipping_status']" value="3">部分确认</eq>
    <eq name="vo['shipping_status']" value="4"><span style="color:#0ACD4B; font-weight:bold;">全部确认</span></eq>
    </td>
    </tr>
    <tr>
      <td colspan="2"><notempty name="vo['yourname']">收货人：{$vo.yourname}　</notempty>会员ID:{$vo.member_id}　<notempty name="vo['nickname']">{$vo.nickname}</notempty><notempty name="vo['tel']">
    <br>
电话：{$vo.tel}
</notempty>
<notempty name="vo['address']">
<br>
地址：{$vo.address}
</notempty>
<notempty name="vo['taxtitle']">
<br>
发票抬头:<span style="color:#f00;">{$vo['taxtitle']}</span>
</notempty>

<p>{$vo.paytypename}</p>

<p>{:getShippingName($vo['shipping_id'])}</p>

<notempty name="vo['Guestbook']">
<p>用户留言：{$vo.Guestbook}</p>
</notempty>





</td>
     
    </tr>
    <tr>
      <td><span style="color:#f00; font-weight:bold; font-size:14px;">¥<span class="ajaxText" tablename="Order" field="total" id="{$vo.id}" val="{$vo.total}" >{$vo.total}</span></span>
    
    
    <gt name="vo['coupon_sn_id']" value="0">
        <p>使用优惠券：{$vo.coupon_sn_id}(<span style="color:#f00;">¥{$vo['coupon_total']}</span>)</p>
    </gt>
    
    
    
    
    <div class="pull-right"><a href="" class="btn btn-success btn-sm" data-toggle="modal" data-target="#myModal"  style="font-size:12px;" onClick=" document.getElementById('order_id').value={$vo.order_id}" >发货</a>　<a onClick="_openWindow('{:U('read',array('supplier_id' =>$supplier_id, 'id'=>$vo['order_id']))}', 800, '查看发货商品', '关闭', null, '');" href="##" class="btn btn-warning btn-sm" >查看</a></div></td>
    </tr>
  </tbody>
</table>
</td>
</tr>
</volist>
            <?php }?>
            <!-- 数据主体结束 -->
            
            <?php if(!IS_AJAX){?>
          </tbody>
        </table>
        <div id="ajaxdatalistpages" class="center-block pages"></div>
      </div>
    </section>
  </div>
  <div class="col-sm-5 col-md-4 col-lg-3">
    
    
    <div class="panel">
      <header class="panel-heading"> 搜索订单 </header>
      <div class="panel-body">
      
      <form id="ajaxdatalistform">
      <div class="input-group m-bot15">
            <input type="text" name="keywords" class="form-control">
            <span class="input-group-btn">
            <button type="button" onClick="$('#ajaxdatalistform').trigger('submit');" class="btn btn-default"><i class="fa fa-search"></i></button>
            </span> </div>
      <notempty name="suppier">
      
      <select name="supplier_id" class="form-control">
          <option value="0">请选择供货商</option>
          <volist name="suppier" id="vo"> <option 
            <eq name="supplier_id" value="$vo['id']">selected="selected"</eq>
             value="{$vo.id}">{$vo.susername}
            </option>
          </volist>
        </select>
      
      </notempty>
      
      <div class="form-group">
     <input class="form-control" type="text" onclick="WdatePicker();" placeholder="开始时间" name="stime" value="" /> 至 <input class="form-control" type="text" onclick="WdatePicker();" placeholder="结束时间" name="etime" value="" /></div>
      
        <div class="form-group"><select name="status" onChange="$('#ajaxdatalistform').trigger('submit');" id="status" class="form-control">
          <option value="">物流状态</option>
         
            <option <eq name="status" value="1">selected="selected"</eq> value="1">已发货</option>
            <option <eq name="status" value="0">selected="selected"</eq> value="0">未发货</option>
        </select></div>
        
        
        
        
        <notempty name="shippingList">
        <select name="shipping_id" onChange="$('#ajaxdatalistform').trigger('submit');" id="shipping_id" class="form-control">
          <option value="">选择物流方式</option>
         <volist name="shippingList" id="vo">
            <option <eq name="shipping_id" value="$vo['id']">selected="selected"</eq> value="{$vo.id}">{$vo.title}</option>
          </volist>
           
            
        </select>
        </notempty>
        
        
        
        <div class="form-group"><select name="getExcel" id="status" class="form-control">
          <option value="">查看列表</option>
          
          
          
          
            <option <eq name="getExcel" value="1">selected="selected"</eq> value="1">导出发货单</option>
            
            
            <option <eq name="getExcel" value="2">selected="selected"</eq> value="2">导出快递单</option>
        </select></div>
        
        
      
        

        
      </form>
      
      
      
      
      
      
      </div>
    </div>
  </div>
</div>
<include file="Public:footer" />
<style>
    .option a.btn{margin-top:5px;}
</style>


  <!-- Modal -->

    <div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"><form action="{:U('logistics')}" method="post">
      <div class="modal-dialog" role="document">
        <div class="modal-content">
          <div class="modal-header">
            <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
            <h4 class="modal-title" id="myModalLabel">物流管理</h4>
          </div>
          <div class="modal-body">
            <label for="exampleInputName2">物流单号</label>
            <br>
            <input type="hidden" value="" id="order_id" name="order_id">
            <input type="text" class="form-control" id="exampleInputName2" name="logistics_num" placeholder="请填写快递物流单号">
          </div>
          <div class="modal-footer">
            <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
            <button type="submit" class="btn btn-primary">确认</button>
          </div>
        </div>
      </div></form>  
    </div>

</body></html><?php }?>